home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 7.2 KB | 226 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: TblLink.h
- // Release Version: $ 1.0d11 $
- //
- // Author: Mary Boetcher
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef TBLLINK_H
- #define TBLLINK_H
-
- // for CCell
- #ifndef TBLPART_H
- #include "TblPart.h"
- #endif
-
- // ----- Framework Layer -----
-
- #ifndef FWLINK_H
- #include "FWLink.h"
- #endif
-
- #ifndef FWLNKMGR_H
- #include "FWLnkMgr.h"
- #endif
-
- #ifndef FWPOINT_H
- #include "FWPoint.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR CTablePart;
- class FW_CLASS_ATTR FW_CPart;
- class FW_CLASS_ATTR FW_CPresentation;
- class FW_CLASS_ATTR CTableSelection;
- class FW_CLASS_ATTR FW_CFrame;
- class FW_CLASS_ATTR ODPart;
- class FW_CLASS_ATTR ODDraft;
- class FW_CLASS_ATTR CBreakLinkSourceCommand;
- class FW_CLASS_ATTR CBreakLinkCommand;
-
- extern const ODPropertyName kODPropSourceLink;
- extern const ODPropertyName kODPropDestLink;
- extern const ODValueType kTableLinkValue;
-
- //========================================================================================
- // class CTablePublishLink
- //========================================================================================
-
- class FW_CLASS_ATTR CTablePublishLink : public FW_CPublishLink
- {
- public:
- FW_DECLARE_CLASS
-
- CTablePublishLink(Environment* ev,
- ODUpdateID changeID,
- FW_CPresentation* presentation,
- CTablePart* part,
- CTableSelection* selection);
- virtual ~ CTablePublishLink();
-
- //--- Inherited from FW_CPublishLink
- virtual void Publish(Environment* ev); // Override
- virtual void ExternalizeLinkContent(Environment* ev, ODStorageUnit* linkSU); // Override
-
- virtual void BreakLink(Environment* ev); // Override
-
- //--- Could move to FW_CPublishLink
- virtual CBreakLinkSourceCommand* DoLinkInfo(Environment *ev, ODFacet* facet);
- virtual void Externalize(Environment* ev, ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo);
-
- //--- Will move to FW_CPublishLink
- virtual FW_CFrame* GetFrameToRevealLink(Environment* ev);
- virtual void DoSelect(Environment* ev, FW_CFrame* frame);
-
- FW_Boolean HasEmbeddedFrame(Environment* ev, ODFrame* odFrame);
-
- //--- Specific to Table part
- CCell GetCell(Environment* ev) const
- { return fLinkCell; };
- void SetCell(Environment* ev, const CCell& cell)
- { fLinkCell = cell; };
-
- private:
- CTablePart* fTablePart;
- CTableSelection* fTableSelection;
- CCell fLinkCell; // cell of the source link
- };
-
- //========================================================================================
- // class CTableSubscribeLink
- //========================================================================================
-
- class FW_CLASS_ATTR CTableSubscribeLink : public FW_CSubscribeLink
- {
- public:
- FW_DECLARE_CLASS
-
- CTableSubscribeLink(Environment* ev,
- ODLink* odLink,
- ODLinkInfo* linkInfo,
- FW_CPresentation* presentation,
- CTablePart* part,
- CTableSelection* destSelection);
- virtual ~ CTableSubscribeLink();
-
- //--- FW_CSubscribeLink overrides
- virtual void Subscribe(Environment* ev); // Override
- virtual void DoUpdateLink(Environment* ev, ODStorageUnit* linkContentSU);
-
- virtual void BreakLink(Environment* ev); // Override
-
- //--- Could move to FW_CSubscribeLink
- FW_CPresentation* GetPresentation(Environment* ev);
- virtual CBreakLinkCommand* DoLinkInfo(Environment* ev, ODFacet* facet);
- virtual void Externalize(Environment* ev, ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo);
-
- //--- Specific to Table part
- CCell GetCell(Environment* ev) const
- { return fLinkCell; };
- void SetCell(Environment* ev, const CCell& cell)
- { fLinkCell = cell; };
-
- private:
- CTablePart* fTablePart;
- CTableSelection* fTableSelection;
- CCell fLinkCell; // cell of the destination link
- };
-
- //========================================================================================
- // CTableSubscribeLink Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CTableSubscribeLink::GetPresentation
- //----------------------------------------------------------------------------------------
- inline FW_CPresentation* CTableSubscribeLink::GetPresentation(Environment* ev)
- {
- return fPresentation;
- }
-
- //========================================================================================
- // class CTableLinkManager
- //========================================================================================
-
- class FW_CLASS_ATTR CTableLinkManager : public FW_CLinkManager
- {
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- CTableLinkManager(Environment* ev, CTablePart* thePart);
- virtual ~CTableLinkManager();
-
- //----------------------------------------------------------------------------------------
- // Override Methods
- //
- public:
- virtual FW_CPublishLink* NewPublishLink(Environment* ev,
- ODUpdateID updateID,
- FW_CPresentation* presentation);
- virtual FW_CSubscribeLink* NewSubscribeLink(Environment* ev,
- ODLink* odLink,
- ODLinkInfo* linkInfo,
- FW_CPresentation* presentation);
-
- virtual void DoChangeLinkStatus(Environment* ev, ODFrame* odFrame);
- // formerly named LinkStatusChanged
-
- virtual void DoUpdateLinks(Environment* ev,
- ODFrame* odEmbeddedFrame,
- ODUpdateID updateID);
- // formerly named EmbeddedFrameUpdated
-
- virtual void RevealLink(Environment* ev, ODLinkSource* linkSource);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void BreakExistingLinks(Environment* ev, const CCell& cell);
- void MoveExistingLinks(Environment* ev,
- const CCell& fromCell,
- const CCell& toCell);
-
- void ExternalizeLinks(Environment* ev, ODStorageUnitView* suView,
- FW_CCloneInfo* cloneInfo);
- void InternalizeLinks(Environment* ev, ODStorageUnit* storageUnit);
-
- CTablePublishLink* CellToPublishLink(Environment* ev, const CCell& cell) const;
- CTableSubscribeLink* CellToSubscribeLink(Environment* ev, const CCell& cell) const;
-
- CTablePublishLink* GetSelectedLinkSource(Environment* ev);
- CTableSubscribeLink* GetSelectedLinkDest(Environment* ev);
-
- void RegisterSubscribers(Environment* ev);
- FW_Boolean ShowLinkInfo(Environment* ev, ODFacet* facet);
-
- void UpdateLinkSource(Environment* ev, ODUpdateID updateID);
-
- private:
- FW_Boolean IsCellInLink(Environment* ev, const CCell& cell);
-
- void InternalizeOneSourceLink(Environment* ev, ODStorageUnitView* suView, ODDraft* suDraft);
- void InternalizeOneDestLink(Environment* ev, ODStorageUnitView* suView, ODDraft* suDraft);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CTablePart* fTablePart;
- };
-
-
- #endif